
body {
  margin: 0;
  background: #f4f6f8;
  color: #333;
}

/* Header */
header {
  background: #1e3a8a;
  color: white;
  padding: 15px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#logoutBtn {
  background: #ef4444;
  border: none;
  color: white;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
}

#logoutBtn:hover {
  background: #dc2626;
}

/* Layout */
main {
  padding: 20px;
}

/* Products */
.products-section h1 {
  margin-bottom: 15px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.product-grid div {
  background: white;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: transform 0.2s ease;
}

.product-grid div:hover {
  transform: translateY(-4px);
}

.product-grid h3 {
  margin: 0 0 8px 0;
}

.product-grid p {
  margin: 4px 0;
}

/*.buyBtn {
  margin-top: 10px;
  width: 100%;
  background: #4facfe;
  border: none;
  color: white;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
}*/
.addCartBtn {
  margin-top: 10px;
  background: #4facfe;
  border: none;
  color: white;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
}

.buyBtn:hover {
  background: #4facfe;
}

/* Orders */
.orders-section {
  margin-top: 40px;
}

#orderList {
  list-style: none;
  padding: 0;
}

#orderList li {
  background: white;
  margin-bottom: 8px;
  padding: 10px;
  border-radius: 6px;
  border-left: 5px solid #3b82f6;
}

#productList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  padding: 20px;
}

.product-card {
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 12px;
  background: #fff;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.product-img {
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  border-radius: 8px;
}

.price {
  font-weight: bold;
  color: #333;
}

.desc {
  font-size: 0.9em;
  color: #555;
}

.buyBtn {
  margin-top: 10px;
  padding: 8px 16px;
  width: auto;        /* 🔥 stops long button */
  border: none;
  border-radius: 6px;
  background-color: #4facfe;
  color: white;
  cursor: pointer;
}

.buyBtn:hover {
  background-color: #4facff;
}

.search-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
  gap: 10px;
}

#searchInput {
  width: 250px;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
}

#searchInput:focus {
  border-color: #1abc9c;
  box-shadow: 0 0 4px rgba(26, 188, 156, 0.5);
}

#searchBtn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background-color: #4facfe;
  color: white;
  font-size: 14px;
  cursor: pointer;
}

#searchBtn:hover {
  background-color: #4facff;
}

/* EACH ITEM (targets your JS output automatically) */
#cartItems > div {
  display: flex;
  align-items: center;
  gap: 20px;
  background: white;
  padding: 15px;
  border-radius: 10px;
  border: 1px solid #ddd;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* IMAGE */
#cartItems img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
}

/* TEXT */
#cartItems h3,
#cartItems p {
  max-width: 900px; 
  /* margin: 4px 0; */
  margin: 20px auto;
}

/* REMOVE BUTTON */
#cartItems button {
  background: #ef4444;
  color: white;
  border-radius: 6px;
  padding: 6px 12px;
}

#cartItems button:hover {
  background: #dc2626;
}

/* CHECKOUT BUTTON */
#checkoutBtn {
  display: block;
  margin: 30px auto;
  background: #4f46e5;
  color: white;
  padding: 12px 25px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

#checkoutBtn:hover {
  background: #3730a3;
}

/* Product detail page */

/* Center the whole content */
#productDetail {
  max-width: 900px;
  margin: 40px auto;
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* ===== TITLE ===== */
h1 {
  margin-left: 40px;
  margin-top: 20px;
}

/* ===== IMAGE SLIDER ===== */
/*.slider {
  position: relative;
  text-align: center;
  margin-bottom: 1;
}*/
  .slider{
    position: relative;
  }

  .slider-btn{
    position: absolute;
    z-index: 5;
  }

#detailImage {
  width: 30%;
  max-height: 400px;   /* reduce height */
  object-fit: contain; /* VERY IMPORTANT */
  object-fit: cover;
  background: #f9f9f9;
  border-radius: 10px;
}

/* Slider buttons */
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  padding: 10px 14px;
  cursor: pointer;
  border-radius: 50%;
}

.slider-btn.left {
  left: 10px;
}

.slider-btn.right {
  right: 10px;
}

.slider-btn:hover {
  background: rgba(0,0,0,0.8);
}

/* ===== PRODUCT INFO ===== */
#detailName {
  font-size: 26px;
  margin-bottom: 10px;
}

#detailDesc {
  color: #555;
  margin-bottom: 15px;
}

#detailPrice {
  font-weight: bold;
  font-size: 18px;
  color: #2ecc71;
}

/* ===== INPUT ===== */
#detailQuantity {
  width: 70px;
  padding: 6px;
  margin-top: 5px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.optionContainer{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:20px;
}

.colorChip{

  padding:10px 18px;

  border:2px solid #ddd;

  border-radius:30px;

  cursor:pointer;

  transition:.2s;

  font-weight:bold;

  user-select:none;

}

.colorChip:hover{

  border-color:#007bff;

}

.colorChip.selected{

  border:2px solid #007bff;

  background:#eaf4ff;

}

.sizeChip{

  padding:10px 18px;

  border:2px solid #ddd;

  border-radius:8px;

  cursor:pointer;

  transition:.2s;

  font-weight:bold;

  user-select:none;

}

.sizeChip:hover{

  border-color:#007bff;

}

.sizeChip.selected{

  border:2px solid #007bff;

  background:#007bff;

  color:white;

}

/* ===== BUTTONS ===== */
#addToCartBtn {
  background: #4f46e5;
  color: white;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 15px;
}

#addToCartBtn:hover {
  background: #4338ca;
}

/* ===== CONTACT SELLER ===== */
#messageInput {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  resize: none;
}

#sendMessageBtn {
  background: #22c55e;
  color: white;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

#sendMessageBtn:hover {
  background: #16a34a;
}

/* ===== BOTTOM BUTTONS ===== */
button[onclick] {
  margin: 20px 10px;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: #06b6d4;
  color: white;
}

button[onclick]:hover {
  background: #0891b2;
}

.bottom-actions {
  text-align: center;
  margin-top: 20px;
}
.chat-box {
  max-height: 220px;   /* height of each product chat */
  overflow-y: auto;    /* scroll per product */
  padding: 10px;
  border: 1px solid #ddd;
  background: #f9f9f9;
  margin-top: 10px;
  border-radius: 8px;
}
.main-wrapper {
  max-width: 900px;     /* controls how wide it is */
  margin: 20px auto;    /* centers it */
  padding: 10px;
}

.chat-container {
  background: white;
  border-radius: 10px;
  padding: 15px;
}
#cartItems,
#cartList {
  max-width: 900px;     /* controls width */
  margin: 20px auto;    /* centers it */
}
.page-title {
  max-width: 900px;
  margin: 20px auto;
}

#card-element{
  border: 1px solid #ccc;
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 15px;
  background: white;
}
.review-card {
  background: white;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 15px;

  box-shadow:
    0 2px 10px rgba(0,0,0,0.08);

  border-left: 5px solid #f5b301;
}

.review-stars {
  font-size: 22px;
  color: #f5b301;
  margin-bottom: 10px;
}

.review-comment {
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  margin-bottom: 12px;
}

.review-author {
  color: #777;
  font-size: 14px;
  font-weight: bold;
}
.reviews-section {
  max-width: 1000px;
  margin: 40px auto;
  padding: 20px;
}

.reviews-section h3 {
  margin-bottom: 20px;
}
.average-rating {

  font-size: 20px;

  color: #f5b301;

  font-weight: bold;

  margin-bottom: 15px;

}

/* ========================================= */
/* RESPONSIVE DESIGN */
/* ========================================= */

/* Tablets */
@media screen and (max-width: 992px) {

  header {
    padding: 15px;
  }

  #productDetail {
    margin: 20px;
    padding: 20px;
  }

  #detailImage {
    width: 60%;
  }

}

/* Phones */
@media screen and (max-width: 768px) {

  header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .search-container {
    flex-direction: column;
    align-items: center;
  }

  #searchInput {
    width: 90%;
  }

  #searchBtn {
    width: 90%;
  }

  #cartItems > div {
    flex-direction: column;
    text-align: center;
  }

  #cartItems img {
    width: 180px;
    height: 180px;
  }

  #detailImage {
    width: 100%;
    max-height: 300px;
  }

  h1 {
    margin-left: 0;
    text-align: center;
  }

}

/* Small Phones */
@media screen and (max-width: 480px) {

  main {
    padding: 10px;
  }

  .product-grid,
  #productList {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .buyBtn,
  .addCartBtn {
    width: 100%;
    font-size: 14px;
    padding: 8px;
  }

  .product-card {
    padding: 10px;
  }

  .product-img {
    max-height: 120px;
  }

}

.notification-btn{
    position:relative;
    display:inline-block;
}


.dashboard-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1daedb;
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: red;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: bold;
}



.logo{
    
  display:flex;
  align-items:center;
  gap:10px;
}

.logo img{
  width:60px;
  height:60px;
  object-fit:contain;
}

.logo span{
  font-size:36px;
  font-weight:700;
  color:#2FA84F;
}

.logo-text{
  font-family: "Poppins", sans-serif;
  font-size: 36px;
  font-weight: 800;
  color: #22A447;
  text-decoration: none;
  letter-spacing: -0.5px;
  transition: color 0.3s ease;
}

.logo-text:hover{
  color: #1B8E39;
}

#checkoutModal{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,.6);

  display: none;

  z-index: 99999;
}

#checkoutModal > div{
  position: relative;
  z-index: 100000;

  background: white;
  width: 420px;
  margin: 80px auto;
  padding: 20px;
  border-radius: 10px;
}